package lambda06;

import org.junit.Test;

import java.util.function.Predicate;

/**Predicate接口
 * @FunctionalInterface
 * public interface Predicate<T> {
 *
 *    boolean test(T t);
 *  }
 *
 */
public class PredicateDemo {
    @Test
    public void test01(){
        Predicate<String> p = str->str.length()>5 ;  // 判断字符串长度是否大于5
        System.out.println(p.test("abc"));   // false
        System.out.println(p.test("abcdef"));  // true
    }
}
